What does this snippet work? It uses session cookie [closed]

Posted by Emerald214 on Programmers See other posts from Programmers or by Emerald214
Published on 2012-03-27T08:55:51Z Indexed on 2012/03/27 11:38 UTC
Read the original article Hit count: 281

Filed under:

My website is a gadget application. It uses CakePHP framework. It has the below snippet in AppController. I searched the cookie variable in the project but can't find any other occurences. I also don't understand what it works. Why does it always check this in every request.

        if ( isset( $_COOKIE[session_name()] ) ) {
            if ( !isset( $this->sns_id ) ) {
                // ?????????
                $this->cakeError( 'session' );
            }               
        }
        else {
            // ??????????????????               
            if ( !isset( $_REQUEST['post_pf_params'] ) ) {
                $this->cakeError( 'cookie' );
            }
        }

© Programmers or respective owner

Related posts about cakephp